-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delay pass creation until time to run #1621
base: main
Are you sure you want to change the base?
Conversation
Logic avoids instantiating a Pass unless it is to be run. To avoid instantiation, only FullPassConfig is passed around.
@@ -32,6 +33,9 @@ | |||
) | |||
from olive.search.utils import cyclic_search_space, order_search_parameters | |||
|
|||
if TYPE_CHECKING: | |||
from olive.engine.config import RunPassConfig |
Check failure
Code scanning / CodeQL
Module-level cyclic import Error
olive.engine.config
olive.passes.olive_pass
definition
import
@@ -20,6 +20,10 @@ | |||
from olive.resource_path import validate_resource_path | |||
from olive.search.search_parameter import SearchParameter, SpecialParamValue, json_to_search_parameter | |||
|
|||
if TYPE_CHECKING: | |||
from olive.hardware.accelerator import AcceleratorSpec | |||
from olive.passes.olive_pass import Pass |
Check failure
Code scanning / CodeQL
Module-level cyclic import Error
olive.passes.olive_pass
olive.passes.pass_config
definition
import
'Pass' may not be defined if module
olive.passes.olive_pass
olive.passes.pass_config
definition
import
|
||
def create_pass_with_args(self, accelerator: "AcceleratorSpec", host_device: Device) -> "Pass": | ||
"""Create a Pass.""" | ||
from olive.package_config import OlivePackageConfig |
Check notice
Code scanning / CodeQL
Cyclic import Note
Delay pass creation until time to run
Logic avoids instantiating a Pass unless it is to be run. To avoid instantiation, only FullPassConfig is passed around.
Checklist before requesting a review
lintrunner -a
(Optional) Issue link